﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ASoft.WPF.ViewModel;

namespace ASoft.WPF.View
{
    /// <summary>
    /// HistoryWSListControl.xaml 的交互逻辑
    /// </summary>
    public partial class HistoryWSListControl : UserControl
    {
        public HistoryWSListControl()
        {
            InitializeComponent();
        }

        private void btnExcel_Click(object sender, RoutedEventArgs e)
        {
            var vm = this.DataContext as WeatherStationInfoViewModel;

            var dict = new Dictionary<string, string>();
            dict["时间"] = "时间";
            dict["室外温度"] = "室外温度";
            dict["风向"] = "风向";
            dict["光照"] = "光照";
            dict["雨雪"] = "雨雪";
            dict["风速"] = "风速";

            WPFUtility.ExcelExport(vm.数据集合.Cast<object>().ToList(), dict);
        }
    }
}
